package com.riant.day03.demo03;
import	java.io.FileOutputStream;

import java.io.BufferedOutputStream;
import java.io.File;

/**
 * @Classname TestFile5
 * @Description TODO
 * @Date 2021/3/6 0:57
 * @Created by 张斌
 */
public class TestFile5 {
    public static void main(String[] args) {
        testWriteFile();
    }

    public static void testWriteFile(){
        File file=new File("day01\\src\\main\\java\\com\\riant\\day03\\demo03\\buffer.txt");
        try {
            FileOutputStream fos = new FileOutputStream(file);
            BufferedOutputStream bufferedOutputStream=new BufferedOutputStream(fos);
            String str="142255";
            bufferedOutputStream.write(str.getBytes("utf-8"));
            bufferedOutputStream.flush();
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
